package com.bdweb.dao;

import com.bdweb.model.POWER;
import com.bdweb.model.WEAK;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface weakDao {
    @Select("select * from bd_medias")
    List<WEAK> findAll();
    @Select("select * from  bd_medias where id=#{id} and mediaName=#{mediaName}  and ip=#{ip}  and port=#{port} and isopen=#{isopen} and  title=#{title} and opencode=#{opencode}  and closecode=#{closecode}  " )
    WEAK findByNameAndPwd(@Param("id") Integer id,@Param("mediaName") String mediaName, @Param("ip") String ip , @Param("port") String port , @Param("isopen") Boolean isopen , @Param("title") String title, @Param("opencode") String opencode , @Param("closecode") String closecode );
    @Insert("insert into from bd_medias values(#{id}, #{mediaName}, #{ip} , #{port}), #{isopen} ,#{title},#{opencode} , #{closecode}")
    Integer addByPower(WEAK weak);
    @Delete("delete from bd_medias where id=#{id}")
    Integer deleteWeakById(Integer id);
    @Update("update from  bd_medias set where id=#{id}, weak_name=#{mediaName},ip=#{ip},port=#{port}, isopen=#{isopen} ,title=#{title},opencode=#{opencode},closecode=#{closecode}")
    Integer updateNameAndPwdById(@Param("id") Integer id, @Param("mediaName") String mediaName,@Param("ip") String ip ,@Param("port") String post, @Param("isopen") Boolean isopen ,@Param("title") String title,@Param("opencode") String opencode ,@Param("closecode") String closecode);

}
